/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tableview;

import data.Vacancyfilldetails;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Hùng
 */
public class VacancyDetailTableView extends AbstractTableModel {

    List<Vacancyfilldetails> lVFD;

    public VacancyDetailTableView() {
    }

    public VacancyDetailTableView(List<Vacancyfilldetails> lVFD) {
        this.lVFD = lVFD;
    }

    public List<Vacancyfilldetails> getlVFD() {
        return lVFD;
    }

    public void setlVFD(List<Vacancyfilldetails> lVFD) {
        this.lVFD = lVFD;
    }

    @Override
    public int getRowCount() {
        if (lVFD != null) {
            return this.lVFD.size();
        }
        return 0;
    }

    @Override
    public int getColumnCount() {
        return 4;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        Object value = null;
        Vacancyfilldetails tmpVFD = lVFD.get(rowIndex);
        switch (columnIndex) {
            case 0:
                value = tmpVFD.getVacancies().getVacancyid();
                break;
            case 1:
                value = tmpVFD.getEmpid().toString();
                break;
            case 2:
                value = tmpVFD.getFilleddate();
                break;
            case 3:
                value = tmpVFD.getIntakedetails();
                break;
        }
        return value;
    }

    @Override
    public String getColumnName(int column) {
        String value = "";
        switch (column) {
            case 0:
                value = "VacancyID";
                break;
            case 1:
                value = "EmployeeId";
                break;
            case 2:
                value = "FillDate";
                break;
            case 3:
                value = "TakeDetails";
                break;
        }
        return value;
    }
}
